<template>
	<view>
		<view style="width: 750rpx;height: 124.43rpx;background: #F5F5F5;line-height: 124.43rpx;color: #3C3C3C;font-size: 33.83rpx;padding-left:38.65rpx ;font-weight: bold;">
			全部老师（{{teacher_num}}）
		</view>
		<scroll-view style="height: 1150rpx;width: 750rpx;" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
			:refresher-threshold="0" refresher-background="#D6D6D6" @refresherpulling="onPulling" @refresherrefresh="onRefresh" :scroll-top="scrollTop"  @scrolltolower="scrolltolower">
			<view style="width: 750rpx;box-sizing: border-box;padding: 0 27.77rpx;">
				<view v-for="(itme,index) in teach_list" :key="index" style="width: 694.6rpx;height: 155.832rpx;background: #FFFFFF;border-radius: 24.15rpx;margin-bottom: 12.684rpx;padding: 31.4rpx 29rpx;box-sizing: border-box;display: flex;justify-content: space-between;align-items: center;" @tap.stop="xuanze(index,itme)">
					<view style="display: flex;overflow: hidden;">
						<view>
							<image :src="itme.photo" style="width: 93rpx;height: 93rpx;border-radius: 50%;"></image>
						</view>
						<view style="margin: 10.27rpx 0 0 28.4rpx;">
							<view style="font-size: 29rpx;color: #383838;font-weight: bold;">{{itme.full_name}}</view>
							<view style="font-size: 29rpx;color: #BFBFBF;margin-top: 10rpx;">{{itme.mobile}}</view>
						</view>
					</view>
					<view style="width: 38.65rpx;height: 38.65rpx;border-radius: 50%;"  :class="list == index ? 'clc':'sty'">
						
					</view>
				</view>
			</view>
		</scroll-view>
		<view style="position: fixed;width: 648.7rpx;height: 85.76rpx;line-height: 85.76rpx;background: #EE7B30;text-align: center;color: #FFFFFF;font-size: 29rpx;border-radius: 42.9rpx;bottom: 10rpx;left: 50.736rpx;" @tap="gopaike">
		   完成
		</view>
		<view style="width: 110rpx;height: 50rpx;background: #EE7B30;color: #FFFFFF;font-size: 23rpx;line-height: 50rpx;text-align: center;position: fixed;top: 20rpx;right: 30rpx;z-index: 1212122;border-radius: 20rpx;" @tap="gotianjian('list')">
			添加老师
		</view>
	</view>
</template>
<script>
	export default {
		data(){
			return {
				mechanism_id:"",
				num:1,
				teach_list:[],
				teacher_num:"",
				list:-1,
				teacher_shu:[],
				canshu:{},
				triggered: false,
				panduan: 1
			}
		},
		methods:{
			onRefresh(){
				this.num = 1
				this.panduan = 2
				this.teach_list = []
				this.laoshi_list()
			},
			xuanze(index,itme){
				let me = this
				me.teacher_shu = []
				me.list = index
				me.teacher_shu.push(itme)
			},
			gopaike(){
				let me = this
				
				let data = {
					data:me.teacher_shu
				}
				let list = Object.assign(me.canshu,data)
				uni.navigateTo({
					url:"/pages/World/moreCurious/moreCurious?num=" + encodeURIComponent(JSON.stringify(list))
				})
			},
			gotianjian(itme){
				uni.navigateTo({
					url:"/pages/Other/theages/theages?num=" + itme
				})
			},
		async	laoshi_list(){
			    let me = this
				if(this.panduan == 2){
					me.triggered = true
				}
				const res = await me.$myRequest({
					url:"/masterInfo/queryListPage",
					data:{
						mechanism_id:me.mechanism_id,
						type:"teach_paypal",
						pageSize:10,
						currentPage:me.num
					}
				})
				if(res.code == 0){
					res.data.forEach((itme) => {
						if(itme.photo.indexOf("h") < 0){
							itme.photo = ""
						}
					})
					me.teach_list = res.data
					me.teacher_num = res.data.length
					me.triggered = false
				}
			}
		},
		onLoad(options) {
			const val = JSON.parse(decodeURIComponent(options.num))
			let me = this
			me.canshu = val
			try{
				me.mechanism_id = uni.getStorageSync('userif_list').mechanism_id
			}catch(e){}
			me.laoshi_list()
		},
		onShow() {
			
		}
	}
</script>
<style>
	.clc{
		border: 0.6rpx solid #EE7B30;
		background: #EE7B30;
	}
	.sty{
		border: 0.6rpx solid #A5A5A5;
		background: #FFFFFF;
	}
</style>